package 字符流复制java文件;
/*
将IO\\字符流\\ConversionStreamDemo复制到copy.java下 （不涉及编码和解码）
数据源：myCharStream\\ConversionStreamDemo.java---读数据---reader---InputStreamReader---FileReader
目的地：myCharStream\\copy.java---写数据---writer---OutputStreamWriter---FileWriter
 */

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class CopyjavaDemo02 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("D:\\javajhx\\IO\\src\\字符流\\ConversionStreamDemo.java");
        FileWriter fw = new FileWriter("co.java");
        int ch;
        while ((ch = fr.read()) != -1) {
            fw.write(ch);
        }
       /* char[]chs=new char[1024];
        int len;
        while((len=fr.read(chs))!=-1){
            fw.write(chs,0,len);
        }*/

        fr.close();
        fw.close();
    }
}
